package web.service;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import web.mapper.GoodsMapper;
import web.mapper.UserMapper;

@Service
public class CommonService {

    @Autowired
    GoodsMapper goodsMapper;

    @Autowired
    UserMapper userMapper;


    public Map<String, Object> fetchInformation() {

        HashMap<String, Object> map = new HashMap<>();

        map.put("users", userMapper.count());
        map.put("goods", goodsMapper.count());
        return map;
    }
}
